class TriageNotesController < ApplicationController
  # GET /triage_notes
  # GET /triage_notes.xml
  layout "backend"
  def index
    @triage_notes = TriageNote.find(:all)
  end

  # GET /triage_notes/1
  # GET /triage_notes/1.xml
  def show
    @triage_note = TriageNote.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @triage_note }
    end
  end

  # GET /triage_notes/new
  # GET /triage_notes/new.xml
  def new
    @triage_note = TriageNote.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @triage_note }
    end
  end

  # GET /triage_notes/1/edit
  def edit
    @triage_note = TriageNote.find(params[:id])
  end

  # POST /triage_notes
  # POST /triage_notes.xml
  def create
    @triage_note = TriageNote.new(params[:triage_note])

    respond_to do |format|
      if @triage_note.save
        flash[:notice] = 'TriageNote was successfully created.'
        format.html { redirect_to(@triage_note) }
        format.xml  { render :xml => @triage_note, :status => :created, :location => @triage_note }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @triage_note.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /triage_notes/1
  # PUT /triage_notes/1.xml
  def update
    @triage_note = TriageNote.find(params[:id])

    respond_to do |format|
      if @triage_note.update_attributes(params[:triage_note])
        flash[:notice] = 'TriageNote was successfully updated.'
        format.html { redirect_to(@triage_note) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @triage_note.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /triage_notes/1
  # DELETE /triage_notes/1.xml
  def destroy
    @triage_note = TriageNote.find(params[:id])
    @triage_note.destroy

    respond_to do |format|
      format.html { redirect_to(triage_notes_url) }
      format.xml  { head :ok }
    end
  end
end
